package control

import (
	"service/app/dao"
	"service/app/dto"
	"service/app/mode"
)

type ApmCont struct {
	BaseContr *BaseContr
	Dao       *dao.ApmDao
}

var apmCont *ApmCont

func ApmContCreate() *ApmCont {
	if apmCont == nil {
		return &ApmCont{
			BaseContr: &BaseContr{},
			Dao:       dao.ApmDaoCreate(),
		}
	}
	return apmCont
}

func (m *ApmCont) ApmAllC() (*[]mode.Db_apm, error) {
	return m.Dao.ApmAllD()
}
func (m *ApmCont) ApmAddC(addTenant *mode.Db_apm) error {
	return m.Dao.ApmAddD(addTenant)
}

func (m *ApmCont) ApmEditC(id *dto.ReqUriIdDto, addTenant *dto.ApmEditDto) error {
	return m.Dao.ApmEditD(id, addTenant)
}

func (m *ApmCont) ApmDelC(id *dto.ReqUriIdDto) error {
	return m.Dao.ApmDelD(id)
}
